import { getSuggestType } from "../../../api/complaints";
Page({
  data: {
    typeList:[],
    adviceModal: false,
  },
  onLoad(option) {
    getSuggestType().then(res =>{
      this.setData({ 
        typeList: res
      })
    })
  },
  onNotice(){
    this.setData({ adviceModal: true})
  },
  typeItemClick(e){
    const { typeId, typeName} = e.target.dataset
    my.navigateTo({
      url: '../complaintSelected/complaintSelected?typeName=' + typeName + '&typeId=' +typeId
    });
  },
  toService(){
    my.reLaunch({ url: '../../../pages/service/service' });
  },
  myComplaint(){
    my.navigateTo({ url: '../complaintManage/complaintManage' });
  },
  closeAdviceModal(){
    this.setData({ adviceModal: false})
  }
});
